package com.scuec.groupfive.Controller;

import com.scuec.groupfive.entity.PracticeRankVO;
import com.scuec.groupfive.service.PracticeRankService;
import com.scuec.groupfive.vo.PracticeRankResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/api/rank")
public class PraticeRankController {

    @Autowired
    private PracticeRankService practiceRankService;

    @GetMapping("/practice")
    public PracticeRankResult getPracticeRank() {
        List<PracticeRankVO> rankList = practiceRankService.getPracticeRankList();
        return new PracticeRankResult(200, "查询成功", rankList);
    }
}